{% extends 'base.html' %}
{% load static %}

{% block title %}
    <title>Invoice List</title>
{% endblock title %}

{% block content %}

    <div class="container">
        <h2>&nbsp;Invoice list</h2>
        <div class="row">
            <div class="col-6">
                {% for invoice in object_list %}
                <div class="card m-2">
                    <div class="card-body">
                        <div class="col">
                            <p class="card-text">
                                <strong>Invoice nr:</strong> {{ invoice.id }}<br>
                                From: {{ invoice.sender }}<br>
                                To: {{ invoice.receiver }}<br>
                                Kind: {{ invoice.kind }}<br>
                                Amount: {{ invoice.amount }}<br>
                                Issued: {{ invoice.date|date:"Y-m-d" }}<br>
                                Due date: {{ invoice.due_date|date:"Y-m-d" }}<br>
                                Status: {{ invoice.status }}<br>
                                <a href="{% url 'erp_core:invoice_update' invoice.id %}" class="btn btn-info btn-sm text-light">
                                    Update invoice
                                </a>

                        </div>
                       
                    </div>
                </div>
                {% endfor %}
            </div>
        </div>
    </div>
    
{% endblock content %}